package edu.aut.bme.hu.orkomet;

import com.soyatec.eface.upf.Window;
import com.soyatec.eface.upf.actions.RoutedEventArgs;

import edu.aut.bme.hu.orkomet.settings.Settings;

public class SettingsDialog extends Window {
	
	private Settings settingsData;
	
	private void setSettingsData(Settings settings) {
		this.settingsData = settings;
	}

	public Settings getSettingsData() {
		return settingsData;
	}
	
	/**
	 * @param sender
	 * @param eventArgs
	 */
	public void btnOk_Click(Object sender, RoutedEventArgs eventArgs) {
		this.setDialogResult(true);
		Application.getCurrentInstance().saveSettings(settingsData);
		close();
	}
	
	public void btnCancel_Click(Object sender, RoutedEventArgs eventArgs) {
		this.setDialogResult(false);
		close();
	}
	
	public SettingsDialog()
	{
		setSettingsData(Application.getCurrentInstance().loadSettings());
	}
	
}
